﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using System.Collections.Generic;
using System.Linq;

#endregion

namespace InterLinq.Test.DH.SQL {
	/// <summary>
	/// Description of the class
	/// </summary>
	[Serializable]
	partial class Order : IOrder {
		#region Public Properties

		/// <summary>
		/// Gets the order position of the order
		/// </summary>
		public IList<IOrderPosition> OrderPositions {
			get { return new List<IOrderPosition>(OrderPositionByOrder.ToArray().Select(x => x.OrderPosition as IOrderPosition)); }
		}

		public void AddOrderPositions(IOrderPosition position) {
			OrderPositionByOrder.Add(new OrderPositionByOrder {
				FK_ID_Order = Id,
				Order = this,
				FK_ID_OrderPosition = position.Id,
				OrderPosition = position as OrderPosition
			});
		}

		// public Properties located here

		#endregion

		#region Public Methods

		// public methods located here

		#endregion

		#region Private Methods

		// private methods located here

		#endregion

		#region Private Fields

		// private fields located here

		#endregion
	}
}